package cn.itcast.bos.dao.base;

import java.util.List;

import org.hibernate.annotations.Where;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.base.Courier;

//要在继承一个接口JpaSpecificationExector
public interface CourierRepository extends JpaRepository<Courier, Integer> ,JpaSpecificationExecutor<Courier>{

	@Query("update Courier set deltag=? Where id=?")
	@Modifying
	public void updateFlag(Character signChar,int id);

	@Query(value="select * from T_COURIER tc where tc.C_ID in (Select tfc.C_COURIER_ID from T_FIXEDAREA_COURIER tfc where tfc.C_FIXED_AREA_ID=?)",nativeQuery=true)
	@Modifying
	public List<Courier> findCourierByFixedAreaId(String fixedAreaId);

}
